// 装备报废
import request from "@/api/request";

// 分页查询所有
export const query_zb = (params) => {
  return request({
    url: "/equipmanage/scrap/selectAll",
    method: "post",
    data: params,
  });
};

//   删除
export const delete_zb = (params) => {
  return request({
    url: "/equipmanage/scrap/delete/" + params,
    method: "post",
  });
};

//   新增
export const add_zb = (params) => {
  return request({
    url: "/equipmanage/scrap/insert",
    method: "post",
    data: params,
    headers: { "Content-Type": "application/json;charset=UTF-8" },
  });
};

// 修改
export const update_zb = (params) => {
  return request({
    url: "/equipmanage/scrap/update",
    method: "post",
    data: params,
    headers: { "Content-Type": "application/json;charset=UTF-8" },
  });
};

//   查详情
export const details_zb = (params) => {
  return request({
    url: "/equipmanage/scrap/selectDetails/" + params,
    method: "post",
  });
};

// 用户列表
export const userList_zb = (params) => {
  return request({
    url: "/equipmanage/scrap/userList/" + params,
    method: "post",
  });
};

//   机构列表
export const orgList_zb = () => {
  return request({
    url: "/equipmanage/scrap/orgList",
    method: "post",
  });
};

//   装备列表
export const equipList_zb = () => {
  return request({
    url: "/equipmanage/scrap/equipList",
    method: "post",
  });
};

//   仓库列表
export const depotList_zb = () => {
  return request({
    url: "/equipmanage/scrap/depotList",
    method: "post",
  });
};

//   储位
export const proOrgList_zb = () => {
  return request({
    url: "/equipmanage/scrap/proOrgList",
    method: "post",
  });
};

//   流程
// 提交
export const submit_zb = (params) => {
  return request({
    url: "/equipmanage/scrap/commit",
    method: "post",
    data: params,
    headers: { "Content-Type": "application/json;charset=UTF-8" },
  });
};
//   审核
export const audit_zb = (params) => {
  return request({
    url: "/equipmanage/scrap/audit",
    method: "post",
    data: params,
    headers: { "Content-Type": "application/json;charset=UTF-8" },
  });
};
//   审核历史
export const history_zb = (params) => {
  return request({
    url: "/equipmanage/scrap/getAuditHistory",
    method: "post",
    data: params,
  });
};
//   回退
export const undo_zb = (params) => {
  return request({
    url: "/equipmanage/scrap/undo",
    method: "post",
    data: params,
  });
};
//   作废
export const cancel_zb = (params) => {
  return request({
    url: "/equipmanage/scrap/cancel",
    method: "post",
    data: params,
  });
};

// 单别
export const category_zballot = (params) => {
  return request({
    url: "/equipmanage/allot/equip/ordCategoryList/" + params,
    method: "post",
  });
};

// 单位
export const unitList_zb = (params) => {
  return request({
    url: "/equipmanage/scrap/unitList",
    method: "post",
    data: params,
  });
};

// 上传附件
export const upload_file = (params) => {
  return request({
    url: "/equipmanage/eadc/upload",
    method: "post",
    data: params,
    headers: { "Content-Type": "multipart/form-data" },
  });
};

// 查询附件列表
export const filelist_file = (params) => {
  return request({
    url: "/equipmanage/eadc/accessoryList/" + params,
    method: "post",
    // headers: { "Content-Type": "application/json;charset=UTF-8" },
  });
};

// 删除附件
export const filedelete_file = (params) => {
  return request({
    url: "/equipmanage/eadc/delete/" + params,
    method: "post",
    // headers: { "Content-Type": "application/json;charset=UTF-8" },
  });
};

// 下载附件
export const download_file = (params) => {
  return request({
    url: `/equipmanage/eadc/download?fileName=${params}`,
    // url: "/equipmanage/eadc/download",
    method: "get",
    data: params,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
    },
    responseType: "blob",
  });
};
